<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>使用Hexo搭建博客 | 小灰灰博客</title><meta name="keywords" content="hexo,博客,安装"><meta name="author" content="小灰灰"><meta name="copyright" content="小灰灰"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一、安装 node.js node.js 官方下载地址 从上面的链接下载 node.js，并安装。 注意：官方链接可能需要翻墙 注意：我的操作系统是Windows 7 (64bit)    设置 npm 淘宝镜像站 npm 默认的源的下载速度可能很慢，建议使用淘宝镜像替换。 执行下面的命令，将 npm 的源设置成淘宝镜像站。  1npm config set registry &quot;http">
<meta property="og:type" content="article">
<meta property="og:title" content="使用Hexo搭建博客">
<meta property="og:url" content="https://www.xiaohuihui.net/posts/eb656981.html">
<meta property="og:site_name" content="小灰灰博客">
<meta property="og:description" content="一、安装 node.js node.js 官方下载地址 从上面的链接下载 node.js，并安装。 注意：官方链接可能需要翻墙 注意：我的操作系统是Windows 7 (64bit)    设置 npm 淘宝镜像站 npm 默认的源的下载速度可能很慢，建议使用淘宝镜像替换。 执行下面的命令，将 npm 的源设置成淘宝镜像站。  1npm config set registry &quot;http">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgitee.com%2Fwangbowen97%2FBlogImgs%2Fraw%2Fmaster%2FpostImages%2FHexoCover.jpg&refer=http%3A%2F%2Fgitee.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1652059164&t=ac7f746ad7621718ece964ce547ba635">
<meta property="article:published_time" content="2022-04-07T21:39:46.000Z">
<meta property="article:modified_time" content="2022-04-11T03:52:48.360Z">
<meta property="article:author" content="小灰灰">
<meta property="article:tag" content="hexo">
<meta property="article:tag" content="博客">
<meta property="article:tag" content="安装">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgitee.com%2Fwangbowen97%2FBlogImgs%2Fraw%2Fmaster%2FpostImages%2FHexoCover.jpg&refer=http%3A%2F%2Fgitee.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1652059164&t=ac7f746ad7621718ece964ce547ba635"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://www.xiaohuihui.net/posts/eb656981"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="referrer" content="no-referrer"><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?2a44015be196a2b1f38395c5cb4e4ae5";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: {"limitDay":500,"position":"top","messagePrev":"该文章已经发布","messageNext":"天了，自从上次更新以来，文章的内容可能已经过时了。"},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"top-right"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '使用Hexo搭建博客',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-04-11 11:52:48'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.1.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">8</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">18</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgitee.com%2Fwangbowen97%2FBlogImgs%2Fraw%2Fmaster%2FpostImages%2FHexoCover.jpg&amp;refer=http%3A%2F%2Fgitee.com&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1652059164&amp;t=ac7f746ad7621718ece964ce547ba635')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">小灰灰博客</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fa fa-paper-plane"></i><span> 留言板</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">使用Hexo搭建博客</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-04-07T21:39:46.000Z" title="发表于 2022-04-08 05:39:46">2022-04-08</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-04-11T03:52:48.360Z" title="更新于 2022-04-11 11:52:48">2022-04-11</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%AD%A6%E6%97%A0%E6%AD%A2%E5%A2%83/">学无止境</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">538</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>2分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="使用Hexo搭建博客"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="一、安装-node-js"><a href="#一、安装-node-js" class="headerlink" title="一、安装 node.js"></a>一、安装 node.js</h1><ul>
<li><a target="_blank" rel="noopener" href="https://nodejs.org/en/">node.js 官方下载地址</a></li>
<li>从上面的链接下载 node.js，并安装。<ul>
<li>注意：官方链接可能需要<strong>翻墙</strong></li>
<li>注意：我的操作系统是<strong>Windows 7 (64bit)</strong></li>
</ul>
</li>
</ul>
<h2 id="设置-npm-淘宝镜像站"><a href="#设置-npm-淘宝镜像站" class="headerlink" title="设置 npm 淘宝镜像站"></a>设置 npm 淘宝镜像站</h2><ul>
<li>npm 默认的源的下载速度可能很慢，建议使用淘宝镜像替换。</li>
<li>执行下面的命令，将 npm 的源设置成淘宝镜像站。</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config set registry &quot;https://registry.npm.taobao.org&quot;</span><br></pre></td></tr></table></figure>

<h1 id="二、安装-hexo"><a href="#二、安装-hexo" class="headerlink" title="二、安装 hexo"></a>二、安装 hexo</h1><ul>
<li>执行以下命令安装 hexo。</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"># 安装hexo</span><br><span class="line">npm install hexo-cli g</span><br><span class="line"># 初始化博客文件夹</span><br><span class="line">hexo init blog</span><br><span class="line"># 切换到该路径</span><br><span class="line">cd blog</span><br><span class="line"># 安装hexo的扩展插件</span><br><span class="line">npm install</span><br><span class="line"># 安装其它插件</span><br><span class="line">npm install hexo-server --save</span><br><span class="line">npm install hexo-admin --save</span><br><span class="line">npm install hexo-generator-archive --save</span><br><span class="line">npm install hexo-generator-feed --save</span><br><span class="line">npm install hexo-generator-search --save</span><br><span class="line">npm install hexo-generator-tag --save</span><br><span class="line">npm install hexo-deployer-git --save</span><br><span class="line">npm install hexo-generator-sitemap --save</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>初探 hexo<br>第一次使用 hexo，在本地创建服务器使用。</p>
<h1 id="生成静态页面"><a href="#生成静态页面" class="headerlink" title="生成静态页面"></a>生成静态页面</h1><p>hexo generate</p>
<h1 id="三、开启本地服务器"><a href="#三、开启本地服务器" class="headerlink" title="三、开启本地服务器"></a>三、开启本地服务器</h1><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># 生成静态页面</span><br><span class="line">hexo generate</span><br><span class="line"># 开启本地服务器</span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p>打开浏览器，地址栏中输入：<a target="_blank" rel="noopener" href="http://localhost:4000/,%E5%BA%94%E8%AF%A5%E5%8F%AF%E4%BB%A5%E7%9C%8B%E8%A7%81%E5%88%9A%E5%88%9A%E5%88%9B%E5%BB%BA%E7%9A%84%E5%8D%9A%E5%AE%A2%E4%BA%86%E3%80%82">http://localhost:4000/,应该可以看见刚刚创建的博客了。</a><br>问题：为什么访问 <a target="_blank" rel="noopener" href="http://localhost:4000/%EF%BC%8C%E6%97%A0%E5%8F%8D%E5%BA%94%EF%BC%9F">http://localhost:4000/，无反应？</a><br>解决方法：可能是由于端口问题引起的。使用 Ctrl+C 中断本地服务，使用命令 hexo s -p 5000 重新开启本地服务，访问<a target="_blank" rel="noopener" href="http://localhost:5000/"><strong>http://localhost:5000/</strong></a>可以看到博客页面了。</p>
<h1 id="四、hexo-命令缩写"><a href="#四、hexo-命令缩写" class="headerlink" title="四、hexo 命令缩写"></a>四、hexo 命令缩写</h1><ul>
<li>hexo 支持命令缩写，如下所示。hexo g 等价于 hexo generate</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">hexo g：hexo generate</span><br><span class="line">hexo c：hexo clean</span><br><span class="line">hexo s：hexo server</span><br><span class="line">hexo d：hexo deploy</span><br></pre></td></tr></table></figure>

<h1 id="hexo-组合命令"><a href="#hexo-组合命令" class="headerlink" title="hexo 组合命令"></a>hexo 组合命令</h1><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"># 清除、生成、启动</span><br><span class="line">hexo clean &amp;&amp; hexo g -s</span><br><span class="line"># 清除、生成、部署</span><br><span class="line">hexo clean &amp;&amp; hexo g -d</span><br></pre></td></tr></table></figure>

<h1 id="常见问题"><a href="#常见问题" class="headerlink" title="常见问题"></a>常见问题</h1><h2 id="hexo-deploy-没有反应？"><a href="#hexo-deploy-没有反应？" class="headerlink" title="hexo deploy 没有反应？"></a>hexo deploy 没有反应？</h2><ul>
<li>修改配置文件：<strong>_config.yml</strong>时，冒号后面没加空格。</li>
</ul>
<h2 id="hexo-s-网站打不开？"><a href="#hexo-s-网站打不开？" class="headerlink" title="hexo s 网站打不开？"></a>hexo s 网站打不开？</h2><ul>
<li>端口占用，换个端口就好了。执行命令 hexo s -p 5000，并在浏览器地址栏输入 <a href="http://localhost:5000，回车访问。">http://localhost:5000，回车访问。</a></li>
</ul>
<h2 id="如何换主题？"><a href="#如何换主题？" class="headerlink" title="如何换主题？"></a>如何换主题？</h2><ul>
<li>将主题下载后，放到 themes 文件夹中即可。例如，下面命令安装 next 主题：git clone <a target="_blank" rel="noopener" href="https://github.com/iissnan/hexo-theme-next">https://github.com/iissnan/hexo-theme-next</a> themes&#x2F;next。</li>
</ul>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://www.xiaohuihui.net">小灰灰</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://www.xiaohuihui.net/posts/eb656981.html">https://www.xiaohuihui.net/posts/eb656981.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://www.xiaohuihui.net" target="_blank">小灰灰博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/hexo/">hexo</a><a class="post-meta__tags" href="/tags/%E5%8D%9A%E5%AE%A2/">博客</a><a class="post-meta__tags" href="/tags/%E5%AE%89%E8%A3%85/">安装</a></div><div class="post_share"><div class="social-share" data-image="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgitee.com%2Fwangbowen97%2FBlogImgs%2Fraw%2Fmaster%2FpostImages%2FHexoCover.jpg&amp;refer=http%3A%2F%2Fgitee.com&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1652059164&amp;t=ac7f746ad7621718ece964ce547ba635" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/6220e42c.html"><img class="prev-cover" src= "" data-lazy-src="/img/default_list.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Hexo使用ButterFly主题</div></div></a></div><div class="next-post pull-right"><a href="/posts/ec39ff9.html"><img class="next-cover" src= "" data-lazy-src="/img/default_list2.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">语雀+Hexo+serverless云函数自动同步</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/posts/6220e42c.html" title="Hexo使用ButterFly主题"><img class="cover" src= "" data-lazy-src="/img/default_list.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-09</div><div class="title">Hexo使用ButterFly主题</div></div></a></div><div><a href="/posts/ec39ff9.html" title="语雀+Hexo+serverless云函数自动同步"><img class="cover" src= "" data-lazy-src="/img/default_list2.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-08</div><div class="title">语雀+Hexo+serverless云函数自动同步</div></div></a></div><div><a href="/posts/f6467537.html" title="小灰灰博客hexo版本上线了"><img class="cover" src= "" data-lazy-src="https://cdn.nlark.com/yuque/0/2022/png/27022430/1649412642465-cba1fe67-6bcd-4869-82b3-115486a6eb3a.png#clientId=u7f87a94d-b3a6-4&crop=0&crop=0&crop=1&crop=1&from=paste&id=u05c878ee&margin=%5Bobject%20Object%5D&name=image.png&originHeight=351&originWidth=657&originalType=url%E2%88%B6=1&rotation=0&showTitle=false&size=83954&status=done&style=none&taskId=u8cbb1d27-73c6-4361-91bd-d6f58bc7509&title=" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-07</div><div class="title">小灰灰博客hexo版本上线了</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">小灰灰</div><div class="author-info__description">小灰灰的精神驿站</div></div><div class="card-info-data is-center"><div class="card-info-data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">8</div></a></div><div class="card-info-data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">18</div></a></div><div class="card-info-data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://www.xiaohuihui.net.cn"><i class="fab fa-gitee"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://gitee.com/xianrenqh/huihui-blog-hexo" target="_blank" title=""><i class="fab fa-gitee"></i></a><a class="social-icon" href="mailto:762229008@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">Welcome To My Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content is-expand"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E5%AE%89%E8%A3%85-node-js"><span class="toc-number">1.</span> <span class="toc-text">一、安装 node.js</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AE%BE%E7%BD%AE-npm-%E6%B7%98%E5%AE%9D%E9%95%9C%E5%83%8F%E7%AB%99"><span class="toc-number">1.1.</span> <span class="toc-text">设置 npm 淘宝镜像站</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E5%AE%89%E8%A3%85-hexo"><span class="toc-number">2.</span> <span class="toc-text">二、安装 hexo</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%94%9F%E6%88%90%E9%9D%99%E6%80%81%E9%A1%B5%E9%9D%A2"><span class="toc-number">3.</span> <span class="toc-text">生成静态页面</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E5%BC%80%E5%90%AF%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="toc-number">4.</span> <span class="toc-text">三、开启本地服务器</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%9B%9B%E3%80%81hexo-%E5%91%BD%E4%BB%A4%E7%BC%A9%E5%86%99"><span class="toc-number">5.</span> <span class="toc-text">四、hexo 命令缩写</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#hexo-%E7%BB%84%E5%90%88%E5%91%BD%E4%BB%A4"><span class="toc-number">6.</span> <span class="toc-text">hexo 组合命令</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98"><span class="toc-number">7.</span> <span class="toc-text">常见问题</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#hexo-deploy-%E6%B2%A1%E6%9C%89%E5%8F%8D%E5%BA%94%EF%BC%9F"><span class="toc-number">7.1.</span> <span class="toc-text">hexo deploy 没有反应？</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#hexo-s-%E7%BD%91%E7%AB%99%E6%89%93%E4%B8%8D%E5%BC%80%EF%BC%9F"><span class="toc-number">7.2.</span> <span class="toc-text">hexo s 网站打不开？</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A6%82%E4%BD%95%E6%8D%A2%E4%B8%BB%E9%A2%98%EF%BC%9F"><span class="toc-number">7.3.</span> <span class="toc-text">如何换主题？</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/adb47c67.html" title="MySQL常用语句"><img src= "" data-lazy-src="https://www.sxkawzp.cn/upload/2020/2/mysql1-12a849f2afe54669a6cc3259e9d380ac.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="MySQL常用语句"/></a><div class="content"><a class="title" href="/posts/adb47c67.html" title="MySQL常用语句">MySQL常用语句</a><time datetime="2022-04-10T18:46:44.000Z" title="发表于 2022-04-11 02:46:44">2022-04-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/e8f88cd9.html" title="php json 处理gbk转码utf-8问题（ json_encode转换数组，值为null）"><img src= "" data-lazy-src="/img/default_list.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="php json 处理gbk转码utf-8问题（ json_encode转换数组，值为null）"/></a><div class="content"><a class="title" href="/posts/e8f88cd9.html" title="php json 处理gbk转码utf-8问题（ json_encode转换数组，值为null）">php json 处理gbk转码utf-8问题（ json_encode转换数组，值为null）</a><time datetime="2022-04-10T18:44:16.000Z" title="发表于 2022-04-11 02:44:16">2022-04-11</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/9bca3d9a.html" title="宝塔WebHook拉取git命令"><img src= "" data-lazy-src="/img/default_list2.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="宝塔WebHook拉取git命令"/></a><div class="content"><a class="title" href="/posts/9bca3d9a.html" title="宝塔WebHook拉取git命令">宝塔WebHook拉取git命令</a><time datetime="2022-04-08T17:45:10.000Z" title="发表于 2022-04-09 01:45:10">2022-04-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/6220e42c.html" title="Hexo使用ButterFly主题"><img src= "" data-lazy-src="/img/default_list.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo使用ButterFly主题"/></a><div class="content"><a class="title" href="/posts/6220e42c.html" title="Hexo使用ButterFly主题">Hexo使用ButterFly主题</a><time datetime="2022-04-08T17:29:05.000Z" title="发表于 2022-04-09 01:29:05">2022-04-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/eb656981.html" title="使用Hexo搭建博客"><img src= "" data-lazy-src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgitee.com%2Fwangbowen97%2FBlogImgs%2Fraw%2Fmaster%2FpostImages%2FHexoCover.jpg&amp;refer=http%3A%2F%2Fgitee.com&amp;app=2002&amp;size=f9999,10000&amp;q=a80&amp;n=0&amp;g=0n&amp;fmt=auto?sec=1652059164&amp;t=ac7f746ad7621718ece964ce547ba635" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="使用Hexo搭建博客"/></a><div class="content"><a class="title" href="/posts/eb656981.html" title="使用Hexo搭建博客">使用Hexo搭建博客</a><time datetime="2022-04-07T21:39:46.000Z" title="发表于 2022-04-08 05:39:46">2022-04-08</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2021 - 2022 By 小灰灰</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my <a target="_blank" rel="noopener" href="https://xiaohuihui.net/">blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function loadValine () {
  function initValine () {
    const valine = new Valine(Object.assign({
      el: '#vcomment',
      appId: 'bfiqRSFKXN6o264vo900neYc-gzGzoHsz',
      appKey: '2SaEN1fWOUIqba7jlD1i9G9B',
      avatar: 'monsterid',
      serverURLs: 'https://bfiqrsfk.lc-cn-n1-shared.com',
      emojiMaps: "",
      path: window.location.pathname,
      visitor: false
    }, null))
  }

  if (typeof Valine === 'function') initValine() 
  else getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine)
}

if ('Valine' === 'Valine' || !true) {
  if (true) btf.loadComment(document.getElementById('vcomment'),loadValine)
  else setTimeout(loadValine, 0)
} else {
  function loadOtherComment () {
    loadValine()
  }
}</script></div><script src="/js/Lete.js"></script><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-ribbon.min.js" size="150" alpha="0.3" zIndex="-1" mobile="true" data-click="false"></script><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>